import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Order from '../views/Order.vue'
import Add_Address from '../views/Add_Address.vue'
import Edit_Address from '../views/Edit_Address.vue'
import Address from '../views/Address.vue'
import CommitOrder from '../views/CommitOrder.vue'
import ShopDetail from '../views/ShopDetail.vue'
import CartZero from '../views/CartZero.vue'
import Signout from '../views/Signout.vue'
import Payment from '../views/Payment.vue'
import Mask from '../views/Mask.vue'
import Search from '../views/Search.vue'
import Search_List from '../views/Search_List.vue'
import SouDetail from '../views/SouDetail.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home,
	children:[
		{
			path:'/home',
			name:'Main',
			component: () => import('../views/Main.vue')
		},
		{
			path:'/home/shopcart',
			name:'ShopCart',
			component: () => import('../views/ShopCart.vue')
		},
		{
			path:'/home/order',
			name:'Order',
			component: () => import('../views/Order.vue')
		},
		{
			path:'/home/mine',
			name:'Mine',
			component: () => import('../views/Mine.vue')
		}
	]
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/',
    name: 'Login',
    component: () => import( '../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/Register.vue')
  },
  {
    path: '/order',
    name: 'Order',
    component: () => import('../views/Order.vue')
  },
  {
    path: '/add_address',
    name: 'Add_Address',
    component: () => import('../views/Add_Address.vue')
  },
  {
    path: '/edit_address',
    name: 'Edit_Address',
    component: () => import('../views/Edit_Address.vue')
  },
  {
    path: '/address',
    name: 'Address',
    component: () => import('../views/Address.vue')
  },
  {
    path: '/commitorder',
    name: 'CommitOrder',
    component: () => import('../views/CommitOrder.vue')
  },
  {
    path: '/shopdetail',
    name: 'ShopDetail',
    component: () => import('../views/ShopDetail.vue')
  },
  {
    path: '/cartzero',
    name: 'CartZero',
    component: () => import('../views/CartZero.vue')
  },
  {
  	path: '/signout',
  	name: 'Signout',
  	component: () => import('../views/Signout.vue')
  },
  {
  	path: '/payment',
  	name: 'Payment',
  	component: () => import('../views/Payment.vue')
  },
  {
  	path: '/mask',
  	name: 'Mask',
  	component: () => import('../views/Mask.vue')
  },
  {
  	path: '/search',
  	name: 'Search',
  	component: () => import('../views/Search.vue')
  },
  {
  	path: '/search_list',
  	name: 'Search_List',
  	component: () => import('../views/Search_List.vue')
  },
  {
  	path: '/soudetail',
  	name: 'SouDetail',
  	component: () => import('../views/SouDetail.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
